home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / readers / utils / posterprint / colourposter.amos / colourposter.amosSourceCode
AMOS Source Code  |  1992-09-02  |  3KB  |  111 lines

  1. Default 
  2. Dim W$(11)
  3. PAP=6 : PAP2=6 : PN=2 : IK1=2 : IK2=8
  4. IX=2 : TX=28 : NL=0
  5. PHT=2 : PWD=1 : CH$="@"
  6. Screen Open 0,640,256,16,Hires
  7. Pen PN : Paper PAP : Hide 
  8.    _SCREEN:
  9. Home : Curs Off : Cls PAP : Cline 
  10. Ink IK2 : Box 0,0 To 639,24
  11. Ink IK1 : Box 1,1 To 638,23
  12. Ink IK2 : Box 0,26 To 639,141
  13. Ink IK1 : Box 1,27 To 638,140
  14. Ink IK2 : Box 0,143 To 639,255
  15. Ink IK1 : Box 1,144 To 638,254
  16. Locate ,1 : Centre "POSTER PRINT - S. Ashmole 11/94"
  17. Gosub DISPLAY
  18.    MAIN:
  19. Gosub DISPLAY
  20. Do 
  21. If Key State(80) Then Gosub _SET_TEXT : Gosub _CALC : Goto MAIN
  22. If Key State(81) Then Gosub _SET_P_HT : Gosub _CALC : Goto MAIN
  23. If Key State(82) Then Gosub _SET_P_W : Gosub _CALC : Goto MAIN
  24. If Key State(83) Then Gosub _SET_COLOR : Goto MAIN
  25. If Key State(84) Then Gosub _CALC : Gosub _PRINT : Goto _SCREEN
  26. If Key State(69) Then Run "hd1:amosprogs/programdriver.amos"
  27. Loop 
  28.    _CALC:
  29. TAB=(80-((PHT*8)*NL))/2
  30. OW$=W$(1) : W$=OW$ : LS=Len(W$)
  31. For N=1 To NL
  32. If Len(W$(N))>Len(OW$) Then W$=W$(N) : LS=Len(W$)
  33. L=(LS*8)-1
  34. Next N
  35. NC=(PWD*8)*LS : VTAB=((64-NC)/2)-3 : Rem -3 adjustment for head of paper
  36. If VTAB<0 Then VTAB=0
  37. Return 
  38.    _PRINT:
  39. If NL=0 or PHT=0 or PWD=0 Then Locate ,IY : Centre "PARAMETER(S) NOT SET!" : Lprint Chr$(7); : Wait 50 : Return 
  40. Cls PAP : Home 
  41. For N=1 To NL
  42. Print W$(N)
  43. Next N
  44. Lprint Chr$(27);"@"
  45. Lprint Chr$(27);Chr$(114);Chr$(KOL)
  46. Do : If Inkey$="" Then Exit : Loop 
  47. Locate ,14 : Centre "SET PRINTER NOW! (then press a key)" : Wait Key : Cline : Centre "PRINTING..."
  48. For N=1 To VTAB : Lprint : Next N
  49. For X=0 To L
  50. For N=1 To PWD
  51. For I=1 To TAB : Lprint " "; : Next I
  52. For Y=(NL*8)-1 To 0 Step -1
  53. If Point(X,Y)=PN Then PR$=CH$ : Else PR$=" "
  54. For M=1 To PHT
  55. Lprint PR$;
  56. Next M
  57. Next Y
  58. Lprint 
  59. Next N
  60. Next X
  61. Lprint Chr$(12)
  62. Return 
  63.    _SET_TEXT:
  64. Locate IX,IY
  65. POSW=80/(PHT*8)
  66. Print "Enter up to";POSW;" lines:-" : Print 
  67. NL=1 : IY=IY+2
  68. Do 
  69. W$(NL)=""
  70. Locate IX,IY
  71. Print "Line";NL;" - "; : Input "Enter text:  ";W$(NL)
  72. If W$(NL)="" Then Exit 
  73. IY=IY+1 : NL=NL+1 : If NL>POSW Then Locate IX,IY : Print "Done!" : Wait Key : Exit 
  74. Loop 
  75. NL=NL-1
  76. Return 
  77.    _SET_P_HT:
  78. OPHT=PHT
  79. Locate IX,IY
  80. Input "Enter print height in chars/pixel:  ";PHT
  81. If PHT=0 Then PHT=OPHT
  82. Return 
  83.    _SET_P_W:
  84. OPWD=PWD
  85. Locate IX,IY
  86. Input "Enter print width in chars/pixel:  ";PWD
  87. If PWD=0 Then PWD=OPWD
  88. Return 
  89.    _SET_COLOR:
  90. Locate IX,IY : Print "0 = Black"
  91. Locate IX,IY+1 : Print "1 = Red"
  92. Locate IX,IY+2 : Print "2 = Blue"
  93. Locate IX,IY+3 : Print "3 = Violet"
  94. Locate IX,IY+4 : Print "4 = Yellow"
  95. Locate IX,IY+5 : Print "5 = Orange"
  96. Locate IX,IY+6 : Print "6 = Green"
  97. Locate 17,IY+6 : Input "Enter colour:  ";KOL$
  98. KOL=Val(KOL$)
  99. Return 
  100.      DISPLAY:
  101. Curs Off 
  102. Cls PAP,2,145 To 637,253
  103. IY=19
  104. Locate TX,6 : Print "F1 - Set text"
  105. Locate TX,7 : Print "F2 - Print height    "; : Paper PAP2 : Print PHT : Paper PAP
  106. Locate TX,8 : Print "F3 - Print width     "; : Paper PAP2 : Print PWD : Paper PAP
  107. Locate TX,9 : Print "F4 - Colour          "; : Paper PAP2 : Print KOL : Paper PAP
  108. Locate TX,10 : Print "F5 - Go!"
  109. Locate TX,13 : Print "Total print length   "; : Paper PAP2 : Print NC : Paper PAP
  110. Locate TX,14 : Print "(Page length = 64)"
  111. Return